<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Create or attach to a message queue</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.msg-get-queue" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">msg_get_queue</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">msg_get_queue</span> &mdash; <span class="dc-title">Create or attach to a message queue</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.msg-get-queue-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>msg_get_queue</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$key</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$perms</code><span class="initializer"> = 0666</span></span>
  ] ) : <span class="type">resource</span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>msg_get_queue()</strong></span> returns an id that can be used to
   access the System V message queue with the given
   <code class="parameter">key</code>. The first call creates the message queue with
   the optional <code class="parameter">perms</code>.
   A second call to <span class="function"><strong>msg_get_queue()</strong></span> for the same
   <code class="parameter">key</code> will return a different message queue
   identifier, but both identifiers access the same underlying message
   queue.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.msg-get-queue-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">key</code></dt>

     <dd>

      <p class="para">
       Message queue numeric ID
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">perms</code></dt>

     <dd>

      <p class="para">
       Queue permissions. Default to 0666. If the message queue already
       exists, the <code class="parameter">perms</code> will be ignored.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.msg-get-queue-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a resource handle that can be used to access the System V message queue.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.msg-get-queue-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="msg_remove_queue.html" class="function" rel="rdfs-seeAlso">msg_remove_queue()</a> - Destroy a message queue</span></li>
    <li class="member"><span class="function"><a href="msg_receive.html" class="function" rel="rdfs-seeAlso">msg_receive()</a> - Receive a message from a message queue</span></li>
    <li class="member"><span class="function"><a href="msg_send.html" class="function" rel="rdfs-seeAlso">msg_send()</a> - Send a message to a message queue</span></li>
    <li class="member"><span class="function"><a href="msg_stat_queue.html" class="function" rel="rdfs-seeAlso">msg_stat_queue()</a> - Returns information from the message queue data structure</span></li>
    <li class="member"><span class="function"><a href="msg_set_queue.html" class="function" rel="rdfs-seeAlso">msg_set_queue()</a> - Set information in the message queue data structure</span></li>
   </ul>
  </p>
 </div>
  

</div></div></div></body></html>